Skip to content

fix(planning): check continuous quintic trajectory limits - #982

Closed
Afloat16 wants to merge 1 commit into
petercorke:mainfrom
Afloat16:fix/quintic-continuous-limits
Closed

Afloat16 wants to merge 1 commit into
petercorke:mainfrom
Afloat16:fix/quintic-continuous-limits

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Problem

The quintic planner checks acceleration and jerk only at its returned samples. It can therefore accept a continuous trajectory that exceeds the requested limits between samples.

For a rest-to-rest move of one unit, dt=5, min_t=5 and max_acc=0.1, main accepts a five-second path whose sampled acceleration is approximately zero. Its actual peak is 0.230940. A separate polynomial has zero endpoint jerk but an interior jerk peak of 1.5, which is also missed by coarse sampling.

Change

Evaluate acceleration and jerk magnitudes at the interval endpoints and the real stationary points of their squared planar norms. Normalize both time and derivative amplitude when finding these points, then evaluate the original components with hypot. The returned samples and their signed profiles retain their existing format.

Behavior change: output sampling no longer determines whether a continuous path satisfies the limits. A previously accepted path may use a longer candidate duration or raise NoPathError when no feasible duration exists.

Validation

  • 39 regressions cover closed-form acceleration and interior-jerk peaks, rotations, near-limit cases, infeasible intervals, time-unit scaling, finite amplitudes of 1e-170/1e170, and zero-derivative controls.
  • Noncollinear planar paths are checked against independent SciPy Bernstein interpolation of the boundary conditions, including dense derivative checks and rejection of each shorter candidate duration.
  • Unchanged main: 19 failed, 20 passed.
  • New tests plus three existing planner modules: 104 passed.
  • mypy: all 166 source files passed. New tests pass Ruff lint/format; git diff --check passes.
  • The full repository/platform matrix was not run locally.

Prior work

Checked all 107 prior fork heads and relevant upstream patches. The only older QuinticPolyPlanner source is identical to main: #909 fixes terminal sampling but retains sample-only limits. #781 adds the failure contract and fixes goal inputs; #736 conditions the separate scalar trajectory generator. None checks continuous path extrema.

Primary contributor: Afloat16.

Prepared with ChatGPT (GPT-6 Astra Pro) assistance.

Check acceleration and jerk magnitudes at polynomial extrema as well as
interval endpoints, so output sampling cannot hide an infeasible path.
Normalize time and derivative amplitude while finding stationary points.

Co-Authored-By: ChatGPT (GPT-6 Astra Pro) <noreply@openai.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 12 complexity · 0 duplication

Metric Results
Complexity 12
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@Afloat16 Afloat16 closed this Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant